import API from "./config"
export default {
  queryGifs (page, pageSize, type) {
    switch (type) {
      case 0:
        return API.post(`/userGift/findNotUsed`, { page, pageSize })
      case 1:
        return API.post(`/userGift/findUsed`, { page, pageSize })
      case 2:
        return API.post(`/userGift/findGiven`, { page, pageSize })
    }
  },

  // 赠送
  giveGif (id) {
    return API.get(`/userGift/sendGift/${id}`)
  },

  myGifDetail (id) {
    return API.get(`/userGift/get/${id}`)
  },

  sendGift (addressId, deliveryStartTime, userGiftId) {
    return API.post(`/userGift/saveAddressDate`, {addressId, deliveryStartTime, userGiftId})
  },

  openGif (id) {
    return API.get(`/userGift/openGift/${id}`) 
  },

  acceptGifDetail (userId, giftId) {
    return API.get(`/userGift/getGivenDetail/${userId}/${giftId}`) 
  },

  acceptGif (id) {
    return API.get(`/userGift/acceptGift/${id}`) 
  }
  

}